package com.bjsxt.controller;

import com.bjsxt.pojo.Emp;
import com.bjsxt.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class EmpController {
    @Autowired
    private EmpService empService;

    @PostMapping("/emp/insert")
    public int insert(Emp emp){
        return empService.insert(emp);
    }
    @PostMapping("/emp/selectAll")
    public List<Emp> showAll(){
        System.out.println("12312");

        return empService.selectAll();
    }
}
